Load Content Blocks in parallel to data fetching on Field view #1077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: PR best viewed with whitespace changes disabled
Network requests before this PR
Note the
api
call is blocking the loading of the views.Network requests after this PR
The
api
call and theviews
calls are done in parallel(NOTE: The
api
call is starting a bit late due to Chrome's concurrent request limit (6). It will start even earlier on a prod deployment under either HTTP/2, or if the Admin UI is served from a different domain to the API)More to come
You'll notice this PR only addresses the
Content
field's blocks and nothing else. I purposely wanted to keep this PR small to guage reception. If it all looks 👍, then I can use the same technique with all the other field types, and forCell
/Filters
too.Motivations
There are two main motivations for this change:
Inspiration
This solution was partly inspired by Facebook's recent F8 video on how they make their dynamic view loading as performant as possible: https://developers.facebook.com/videos/2019/building-the-new-facebookcom-with-react-graphql-and-relay/